package net.hombrecero.bigbeat.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.AccessType;

@Entity
@AccessType( "field" )
public class Result extends Base {
  public static final int RESULTSTATUS_PROCESSING_STOPED  = 1;
  public static final int RESULTSTATUS_PROCESSING_RUNNING = 2;
  public static final int RESULTSTATUS_PROCESSED_OK       = 4;
  public static final int RESULTSTATUS_PROCESSED_ERROR    = 8;



    @ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.MERGE } )
    @JoinColumn( name="uuidWorkUnit", nullable=false )
    private WorkUnit workUnit;
  @Column( nullable = false )
  private int resultStatus = RESULTSTATUS_PROCESSING_STOPED;
  private Date createTime;
  private Date sentTime;
  private Date lastModTime;
  private Date receivedTime;
  @Column( length=32, nullable = false )
  private String resultStatusDescription;
  @Column( length=256, nullable = false )
  private String url;


  public Date getCreateTime() {
    return this.createTime;
  }
  public void setCreateTime( Date createTime ) {
    this.createTime = createTime;
  }
  public Date getLastModTime() {
    return this.lastModTime;
  }
  public void setLastModTime( Date lastModTime ) {
    this.lastModTime = lastModTime;
  }
  public Date getReceivedTime() {
    return this.receivedTime;
  }
  public void setReceivedTime( Date receivedTime ) {
    this.receivedTime = receivedTime;
  }
  public int getResultStatus() {
    return this.resultStatus;
  }
  public void setResultStatus( int resultStatus ) {
    this.resultStatus = resultStatus;
  }
  public String getResultStatusDescription() {
    return this.resultStatusDescription;
  }
  public void setResultStatusDescription( String resultStatusDescription ) {
    this.resultStatusDescription = resultStatusDescription;
  }
  public Date getSentTime() {
    return this.sentTime;
  }
  public void setSentTime( Date sentTime ) {
    this.sentTime = sentTime;
  }
  public WorkUnit getWorkUnit() {
    return this.workUnit;
  }
  public void setWorkUnit( WorkUnit workUnit ) {
    this.workUnit = workUnit;
  }
  public String getUrl() {
    return this.url;
  }
  public void setUrl( String url ) {
    this.url = url;
  }
}
